<template>
	<view class="uni-container">
		<view class="headerCard">
			<view class="card">
				<view class="warn">商家已确认，正在制作中~</view>
				<view class="tips">请您耐心等待</view>
			</view>
		</view>
		<view class="mapCard">
			<view class="card">
				<view class="map">
					<view class="MerchantName">商家名称</view>
					<view class="Address">详细地址详细地址详细地址详细地址详细地址详细地址</view>
				</view>
				<view class="tableid">1号桌</view>
			</view>
		</view>
		<view class="mainCard">
			<view class="card">
				<!-- <scroll-view class="order" scroll-y="true"> -->
					<view class="cardBody" v-for="(item,index) in  list" :key="index">
						<image class="imagePng" :src="item.url" />
						<view class="textBody">
							<view class="title">{{item.title}}
								<view class="iconBody">￥{{item.number}}</view>
							</view>
							<view class="text">{{item.text}}</view>
							<view>×{{item.value}}</view>
						</view>
					
					</view>
				<!-- </scroll-view> -->
				<view class="allPrice">
					<view class="status">{{orderStatus}}</view>
					<view class="price">总价:<text>{{value}}</text></view>
				</view>
			</view>
		</view>
		<view class="noteCard">
			<view class="card">
				<view class="notes">备注<text>{{notes}}</text></view>
			</view>
		</view>
		<view class="noteCard">
			<view class="card">
				<view class="notes">订单号<text>{{orderNum}}</text></view>
				<view class="notes">下单时间<text>{{orderTime}}</text></view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				textValue: '',
				maxLength: 50,
				list: [{
						title: '红烧牛肉',
						text: "150g牛肉",
						number: 50,
						value: 1,
						url: 'http://localhost:8080/static/lbt3.png'
					},
					{
						title: '红烧牛肉',
						text: "150g牛肉",
						number: 50,
						value: 1,
						url: 'http://localhost:8080/static/lbt3.png'
					},
					{
						title: '红烧牛肉',
						text: "150g牛肉",
						number: 50,
						value: 1,
						url: 'http://localhost:8080/static/lbt3.png'
					},
					{
						title: '红烧牛肉',
						text: "150g牛肉",
						number: 50,
						value: 1,
						url: 'http://localhost:8080/static/lbt3.png'
					},
					{
						url: 'http://localhost:8080/static/lbt3.png',
						title: '草莓核桃奶盖',
						text: '冷饮',
						number: 15,
						value: 2
					}
				],
				value: 0,
				orderStatus:'待付款',
				notes:'备注',
				orderNum:'123456',
				orderTime:'2024',
			};
		},
		mounted() {
			this.list.forEach((item, index) => {
				let valueNum = item.value * item.number
				this.value += valueNum
			})
			console.log(this.value)
		},
	}
</script>

<style lang="scss" scoped>
	.headerCard {
		height: 200rpx;
		padding: 20rpx 30rpx;
		.card {
			border-radius: 10px;
			text-align: center;
			background: #fff;
			width: 100%;
			height: 100%;
			display: flex; 
			flex-direction: column; 
			justify-content: center;
			.warn{
				width: 100%;
				font-size: 16px;
				color: #FF922C;
			}
			.tips{
				width: 100%;
				font-size: 14px;
				color: #666666;
			}
		}

		// margin-bottom: 25rpx;
		// margin-top: 5rpx;
	}
	.mapCard {
		height: 200rpx;
		padding: 10rpx 30rpx;
		.card {
			border-radius: 10px;
			// text-align: center;
			background: #fff;
			width: 100%;
			height: 100%;
			display: flex; 
			flex-direction: row; 
			justify-content: center;
			.map{
				display: flex;
				flex-direction: column;
				justify-content: center;
				width: 100%;
				padding-left: 25rpx;
				.MerchantName{
					font-size: 16px;
				}
				.Address{
					font-size: 12px;
					color: #999999;
				}
			}
			.tableid{
				text-align: center;
				font-weight: 800;
				width: 100%;
				font-size: 18px;
				color: #EC3636;
				line-height: 200rpx;
			}
		}
	
		// margin-bottom: 25rpx;
		// margin-top: 5rpx;
	}
	.mainCard{
		// height: 200rpx;
		padding: 10rpx 30rpx;
		.card{
			border-radius: 10px;
			// text-align: center;
			background: #fff;
			width: 100%;
			height: 100%;
			display: flex; 
			flex-direction: column; 
			// justify-content: center;
			// .order{
			// 	height: 500rpx;
			// 	width: calc(100% - 60rpx);
			// 	padding: 20rpx 30rpx;
			// 	margin-bottom: 25rpx;
			// }
			.cardBody {
				height: 188rpx;
				background: #fff;
				margin: 10rpx 20rpx;
				border-radius: 10rpx;
				display: flex;
				flex-direction: row;
				padding: 30rpx 10rpx 0;
				.iconBody {
					float: right;
					color: #EC3636;
				}
				.imagePng {
					width: 160rpx;
					height: 160rpx;
					border-radius: 10rpx;
				}
			
				.textBody {
					padding: 10rpx;
					width: calc(100% - 160rpx)
				}
			
				.title {
					text-align: left;
					font-size: 14px;
					font-weight: 500;
				}
			
				.text {
					text-align: left;
					font-size: 10px;
					font-weight: 350;
					height: 60rpx;
					padding: 0;
			
				}
			}
			.allPrice{
				text-align: right;
				margin: 20rpx 40rpx;
				.status{
					color: #EC3636;
				}
				.price{
					font-size: 16px;
					text{
						font-size: 18px;
						padding: 10rpx;
						color: #EC3636;
					}
				}
			}
		}
	}
	.noteCard{
		// height: 150rpx;
		padding: 10rpx 30rpx;
		margin-bottom: 30rpx;
		.card{
			// line-height: 150rpx;
			border-radius: 10px;
			// text-align: center;
			background: #fff;
			width: 100%;
			height: 100%;
			Box-sizing:border-box;
			display: flex;
			flex-direction: column; 
			justify-content: center;
			padding: 40rpx;
			color: #666666;
			overflow: auto;
			text{
				padding: 0 30rpx;
				color: black;
				font-size: 16px;
			}
		}
	}
	
</style>
